//
//  ThirdTableViewCell.m
//  YouMin_iOS
//
//  Created by lanou3g on 15/12/10.
//  Copyright © 2015年 wey. All rights reserved.
//

#import "ThirdTableViewCell.h"
#import "EntityModel.h"
@interface ThirdTableViewCell ()
///  title
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
///  Description
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
///  loc
@property (weak, nonatomic) IBOutlet UILabel *locLabel;
///  nickIcon
@property (weak, nonatomic) IBOutlet UIImageView *nickIcon;
///  nickName
@property (weak, nonatomic) IBOutlet UILabel *nickNameLabel;

@property (weak, nonatomic) IBOutlet UIImageView *headerView;

@end
static NSString *str = @"";
@implementation ThirdTableViewCell

- (void)setModel:(EntityModel *)model {

    _model = model;
///  字体高亮
    self.titleLabel.font = [UIFont systemFontOfSize:14 weight:20];
    self.descLabel.font = [UIFont systemFontOfSize:12 weight:20];
    self.nickNameLabel.font = [UIFont systemFontOfSize:12 weight:20];
        self.locLabel.font = [UIFont systemFontOfSize:10 weight:20];

    if (model.type == 4) {
        str = model.name;
        self.locLabel.text = model.popular_place_str;
    }else{

        str = model.index_title;
    }

    self.titleLabel.text = str;
    self.titleLabel.preferredMaxLayoutWidth = [UIScreen mainScreen].bounds.size.width - 10;
    self.descLabel.text = model.first_day;
    self.nickNameLabel.text = model.nickName;
    self.headerView.layer.cornerRadius = 6;
    self.headerView.layer.masksToBounds = YES;
    self.nickIcon.layer.cornerRadius = 12;
    self.nickIcon.layer.masksToBounds = YES;
    [self.nickIcon sd_setImageWithURL:[NSURL URLWithString:model.nickImgUrl] placeholderImage:[UIImage imageNamed:placeHolder]];
    [self.headerView sd_setImageWithURL:[NSURL URLWithString:model.cover_image] placeholderImage:[UIImage imageNamed:placeHolder]];

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
